//登录成功以及出现退出登录
var name=document.getElementsByClassName('userName')[0];
var login=document.getElementsByClassName('login')[0];
var persons=document.getElementsByClassName('persons')[0];
var out=document.getElementsByClassName('out')[0];
var hideLogOut = document.getElementsByClassName('hideLogOut')[0];
var hideLogOutContent = document.getElementsByClassName('hideLogOutContent')[0];
var logOutNoBtn=document.getElementsByClassName('logOutNoBtn')[0];
var logOutYesBtn=document.getElementsByClassName('logOutYesBtn')[0];
if(localStorage.getItem('userHao')!=null || localStorage.getItem('sign')==1){
    login.style.display='none';
    persons.style.display='block';
}
console.log(localStorage.getItem('userHao'))
console.log(localStorage.getItem('password'))
out.onclick=function(){
    setTimeout(function(){
        hideLogOut.style.display = 'block';
        hideLogOutContent.style.opacity = '1';
        hideLogOutContent.style.transform = "translate(" + -50 + "%," + 400 + "px)";
    },1)
    logOutNoBtn.onclick = function(){
        hideLogOutContent.style.opacity = '0';
        hideLogOutContent.style.transform = "translate(" + -50 + "%," + -400 + "px)";
        hideLogOut.style.display = 'none';
    }
//点击确认会退出登录
    logOutYesBtn.onclick = function(){
        hideLogOutContent.style.opacity = '0';
        hideLogOutContent.style.transform = "translate(" + -50 + "%," + -400 + "px)";
        hideLogOut.style.display = 'none';
        persons.style.display='none';
        login.style.display='block';
        localStorage.removeItem('userHao');
        localStorage.removeItem('password');
        localStorage.removeItem('sign');
        window.location.href="http://localhost:8080/future/out";
    }
}
